package com.zjx.springcloud.controller;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.zjx.springcloud.constant.HttpCode;
import com.zjx.springcloud.entities.Dept;
import com.zjx.springcloud.entities.ResultVO;
import com.zjx.springcloud.entities.test.Test;
import com.zjx.springcloud.service.DeptService;
import com.zjx.springcloud.utils.LanguageUtils;
import org.apache.solr.client.solrj.SolrClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * spring boot demo 接口
 */
@SuppressWarnings("all")
@RestController
@RequestMapping("/config")
public class ConfigController {



    @HystrixCommand(fallbackMethod="my")
    @RequestMapping(value = "/queryAll")
    public ResultVO queryAll(

        ) {
        return new ResultVO(HttpCode.REQUEST_SUCCESS_CODE, LanguageUtils.getDefaultText("success"));
    }


    public ResultVO my(){
        return new ResultVO(HttpCode.REQUEST_ERROR_CODE, LanguageUtils.getDefaultText("request_error"));
    }

}
